Stops the current activity by abandoning it without saving data and without further processing of navigation rules.
Parent Type: StoredLearningSession
Namespace: Microsoft.LearningComponents.Storage
Assembly: Microsoft.LearningComponents.Storage.dll
| C# |
|
public override void AbandonCurrentActivity () |
| Exception type | Condition |
| InvalidOperationException | Thrown if this method is called when there is no current activity in the session. |
| SequencingException | Thrown if the state of the session, such as the current sequencing rules, do not allow processing the requested navigation. |
Pending data model changes and other session changes that result from this method are not saved and should be persisted to long-term storage by calling CommitChanges after this method and prior to disposing the object.
PostCondition rules are not run after the activity has been abandoned. Any current value of NavigationRequest.ExitMode of LearningDataModel.NavigationRequest will be ignored, and the AttemptStatus of the attempt on the activity will be set to Abandonded.
Once this method is called, the current activity will no longer be active for this session. That is, LearningSession.CurrentActivityIsActive will be false. To continue the session, select an activity to attempt using one of the MoveToActivity methods.